﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace JustMetClient.Tools.TbUtil
{
    public class TextBoxTools
    {
        /// <summary>
        /// 检查TextBox数据格式，只能为数字
        /// </summary>
        /// <returns></returns>
        public static bool CheckTextBox(TextBox textBox)
        {
            if (!int.TryParse(textBox.Text, out int result_x))
            {
                MessageBox.Show("只能输入数字");
                textBox.Text = "10";
                return false;
            }
            
            return true;
        }

    }
}
